package za.org.jcicada.genss.sensor;

import java.util.Observer;

import za.org.jcicada.genss.sensor.impl.InvalidSensorValue;
import za.org.jcicada.genss.sensor.impl.SensorStatusValue;


/**
 * ISensor.java
 *
 * @author Simon Cross
 *
 * Created on November 11, 2008, 18:45
 */

/**
 * Interface to a generic subsystem sensor.
 */
public interface ISensor {

    /**
     * Adds an observer to the set of observers for this object, provided 
     * that it is not the same as some observer already in the set. 
     * The order in which notifications will be delivered to multiple 
     * observers is not specified. See the class comment.
     *
     * @param   o   an observer to be added.
     * @throws NullPointerException   if the parameter o is null.
     */
    void addObserver(Observer o);

    /**
     * Deletes an observer from the set of observers of this object. 
     * Passing <CODE>null</CODE> to this method will have no effect.
     * @param   o   the observer to be deleted.
     */
    void deleteObserver(Observer o);

    /**
     * Returns the number of observers of this <tt>Observable</tt> object.
     *
     * @return  the number of observers of this object.
     */
    int countObservers();
    
    ISensorType getType();
    
    String getName();
    
    String getDescription();
    
    String getUnits();
    
    void setValue(ISensorValue value) throws InvalidSensorValue;
    
    void setValue(long time, Object value) throws InvalidSensorValue;
    
    void setValue(Object value) throws InvalidSensorValue;
    
    void setStatusValue(SensorStatusValue statusValue) throws InvalidSensorValue;
    
    ISensorValue getValue();
    
    SensorStatusValue getStatusValue();
}
